package org.crazyit.activiti_d2._3_Retry;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineInfo;
import org.activiti.engine.ProcessEngines;

import java.net.URL;
import java.util.Map;

public class Retry {

    public static void main(String[] args) {

        //1. 得到资源文件的URL 实例
        ClassLoader cl = Retry.class.getClassLoader();
        URL url = cl.getResource("activiti-context_1.xml");

        //2. 调用retry 方法创建ProcessEngine 实例
        ProcessEngineInfo info = ProcessEngines.retry(url.toString());

        //3. 得到流程实例保存对象
        Map<String, ProcessEngine> engines = ProcessEngines.getProcessEngines();
        System.out.println("调用retry 方法后引擎数: " + engines.size());

    }

}
